package cn.fj.hrm.controller;

import cn.fj.hrm.basic.util.JsonResult;
import cn.fj.hrm.dto.UserDto;
import cn.fj.hrm.service.IVipUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/verifyCode")
public class VerifyCodeController {

    @Autowired
    private IVipUserService userService;

    /**
     * 获取图形验证码图片的base64编码字符串
     * @param imageCodeKey
     * @return
     */
    @GetMapping("/generateImageCode/{imageCodeKey}")
    public JsonResult generateImageCode(@PathVariable("imageCodeKey")String imageCodeKey){
        return userService.generateImageCode(imageCodeKey);
    }

    /**
     * 获取短信验证码
     * @param userDto
     * @return
     */
    @PostMapping("/sendSmsCode")
    public JsonResult sendSmsCode(@RequestBody UserDto userDto){

        return userService.sendSmsCode(userDto);
    }
}
